var util = require('../../utils/util')
var api = require('../../config/api.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    let that = this
    const eventChannel = this.getOpenerEventChannel()
    // 监听acceptDataFromOpenerPage事件，获取上一页面通过eventChannel传送到当前页面的数据
    eventChannel.on('row', function (data) {
      that.setData({
        report: data,
        imgList: (data.fliePath || '').split(';').filter(item => item !== ''),

      })

    })
  

  },

  //浏览图片
  ViewImage(e) {
    wx.previewImage({
      urls: this.data.imgList,
      current: e.currentTarget.dataset.url
    });
  },
  checkPhone(event) {
    let row = event.currentTarget.dataset.data;
    wx.makePhoneCall({
      phoneNumber: row,
      success: function (res) {
        console.log(res)
      },
      fail: function (err) {
        console.log(err)
      }
    })
  },



  //进度条
  loadModal() {
    this.setData({
      loadModal: true
    })
  },
  closeModal() {
    this.setData({
      loadModal: false
    })
  },


})